import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ProjectinfoVO, ProjectinfoForm, ProjectinfoQuery } from '@/api/project/projectinfo/types';

/**
 * 查询项目信息列表
 * @param query
 * @returns {*}
 */

export const listProjectinfo = (query?: ProjectinfoQuery): AxiosPromise<ProjectinfoVO[]> => {
  return request({
    url: '/project/projectinfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询项目信息详细
 * @param id
 */
export const getProjectinfo = (id: string | number): AxiosPromise<ProjectinfoVO> => {
  return request({
    url: '/project/projectinfo/' + id,
    method: 'get'
  });
};

/**
 * 新增项目信息
 * @param data
 */
export const addProjectinfo = (data: ProjectinfoForm) => {
  return request({
    url: '/project/projectinfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改项目信息
 * @param data
 */
export const updateProjectinfo = (data: ProjectinfoForm) => {
  return request({
    url: '/project/projectinfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除项目信息
 * @param id
 */
export const delProjectinfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/project/projectinfo/' + id,
    method: 'delete'
  });
};
